﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SensorDrone.Net
{
    /// <summary>
    /// An interface to communicate with the drone
    /// </summary>
    public interface IDroneChannel
    {
        /// <summary>
        /// Write a sequence of bytes
        /// </summary>
        /// <param name="data">A byte array of data</param>
        void Write(byte[] data);
        /// <summary>
        /// Read a sequence of bytes
        /// </summary>
        /// <param name="buffer">Buffer to read into</param>
        /// <returns>The number of bytes read</returns>
        int Read(byte[] buffer);
        /// <summary>
        /// Perform a write/read operation
        /// </summary>
        /// <param name="request">Bytes to write</param>
        /// <returns>Response read back</returns>
        byte[] Request(byte[] request);
        
    }
}
